import service from "@/utils/request";

const prefix = 'algorithmController/';

//算法详情
export const algorithmData = (data) => {
    return service.post(`algorithmController/getAlgorithmInfo`, data)
}
//自定义算法
export const customData = (data) => {
    return service.post(`algorithmController/getDefinedAlgorithm`, data)
}
//自定义算法删除
export const customDel = (data) => {
    return service.post(`algorithmController/delDefinedAlgorithm`, data)
}
//文件上传保存
export const customFild = (data) => {
    return service.post(`algorithmController/saveDefinedAlgorithm`, data, {
        headers: {
            'Content-Type': 'multipart/form-data',
        }
    })
}
//自定义算法编辑
export const customUpdate = (data) => {
    return service.post(`algorithmController/updateDefinedAlgorithm`, data)
}
//算法超市共享调用
export const algorithmSharing = (data) => {
    return service.post(`algorithmController/getShareAlgorithms`, data)
}
//算法超市共享发布
export const shareAlgorithms = (data) => {
    return service.post(`algorithmController/shareAlgorithms`, data)
}
//算法超市算法操作
export const algorithmOperation = (data) => {
    return service.post(`algorithmController/algorithmOperation`, data)
}
//算法评论/回复
export const sendAlsComment = (data) => {
    return service.post(`algorithmController/sendAlsComment`, data)
}
//算法 删除
export const deleteAlsComment = (data) => {
    return service.post(`algorithmController/deleteAlsComment`, data)
}
/**
 * 查询分页算法
 * @param {Object} pageLimit 
 * @returns 分页算法
 */
export const getAlgorithmInfos = (pageLimit) => {
    return service.post(prefix + 'getAlgorithmInfos', pageLimit)
}


/**
 * 查询所有算法的算法分类
 * @returns 算法的所有类别
 */
export const getAllAlgorithmClass = () => {
    return service.post(prefix + 'getAllAlgorithmClass')
}

export const likeORNotLikeAls = (data) => {
    return service.post(prefix + 'likeORNotLikeAls', data)
}

export const addAlsViewCounts = (data) => {
    return service.post(prefix + 'addAlsViewCounts', data)
}

/**
 * 查询算法的所有评论
 */
export const readAlsComment = (data) => {
    return service.post(prefix + 'readAlsComment', data)
}

